<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <title>社交活动平台 - 报名确认</title>
    <style>
        /* 重置样式 */
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
            background-color: #f5f7fa;
            color: #333;
            line-height: 1.6;
        }

        /* 容器样式 */
        .container {
            max-width: 480px;
            margin: 0 auto;
            background-color: #fff;
            min-height: 100vh;
        }

        /* 头部导航 */
        .header {
            position: sticky;
            top: 0;
            background-color: white;
            padding: 16px;
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
            z-index: 100;
        }

        .header-content {
            display: flex;
            align-items: center;
            justify-content: space-between;
        }

        .back-btn {
            background: none;
            border: none;
            font-size: 24px;
            cursor: pointer;
            color: #333;
        }

        .header-title {
            font-size: 18px;
            font-weight: bold;
            flex-grow: 1;
            text-align: center;
        }

        .action-btn {
            background: none;
            border: none;
            font-size: 20px;
            cursor: pointer;
            color: #333;
        }

        /* 报名确认卡片 */
        .confirmation-card {
            padding: 32px 16px;
            text-align: center;
        }

        .confirmation-icon {
            font-size: 80px;
            margin-bottom: 24px;
            color: #4caf50;
        }

        .confirmation-title {
            font-size: 24px;
            font-weight: bold;
            margin-bottom: 16px;
            color: #333;
        }

        .confirmation-subtitle {
            font-size: 16px;
            color: #666;
            margin-bottom: 32px;
        }

        /* 活动信息卡片 */
        .activity-card {
            background-color: #f9f9f9;
            border-radius: 16px;
            padding: 20px;
            margin-bottom: 32px;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
        }

        .activity-cover {
            width: 100%;
            height: 160px;
            object-fit: cover;
            border-radius: 12px;
            margin-bottom: 16px;
        }

        .activity-title {
            font-size: 20px;
            font-weight: bold;
            margin-bottom: 12px;
            color: #333;
        }

        .activity-meta {
            display: flex;
            align-items: center;
            gap: 12px;
            margin-bottom: 8px;
            font-size: 14px;
            color: #666;
        }

        .meta-item {
            display: flex;
            align-items: center;
        }

        .meta-icon {
            margin-right: 6px;
        }

        .activity-tags {
            display: flex;
            gap: 8px;
            margin-top: 12px;
        }

        .tag {
            background-color: #f0f8ff;
            color: #45b7d1;
            padding: 4px 12px;
            border-radius: 12px;
            font-size: 12px;
        }

        /* 报名信息 */
        .registration-info {
            background-color: #f0f8ff;
            border-radius: 16px;
            padding: 20px;
            margin-bottom: 32px;
        }

        .info-title {
            font-size: 18px;
            font-weight: bold;
            margin-bottom: 20px;
            color: #333;
        }

        .info-item {
            display: flex;
            justify-content: space-between;
            padding: 12px 0;
            border-bottom: 1px solid #eee;
        }

        .info-item:last-child {
            border-bottom: none;
        }

        .info-label {
            color: #666;
        }

        .info-value {
            font-weight: bold;
        }

        /* 操作按钮 */
        .action-buttons {
            display: flex;
            gap: 16px;
            margin-bottom: 32px;
        }

        .action-btn {
            flex: 1;
            padding: 16px;
            border-radius: 24px;
            font-size: 16px;
            font-weight: bold;
            cursor: pointer;
            transition: all 0.3s ease;
            border: none;
        }

        .cancel-btn {
            background-color: #f5f5f5;
            color: #666;
        }

        .cancel-btn:hover {
            background-color: #e0e0e0;
        }

        .confirm-btn {
            background: linear-gradient(135deg, #ff6b35 0%, #f9a825 100%);
            color: white;
        }

        .confirm-btn:hover {
            transform: translateY(-2px);
            box-shadow: 0 6px 16px rgba(255, 107, 53, 0.4);
        }

        /* 底部导航 */
        .bottom-nav {
            position: fixed;
            bottom: 0;
            left: 0;
            right: 0;
            background-color: white;
            border-top: 1px solid #eee;
            display: flex;
            justify-content: space-around;
            padding: 12px 0;
            z-index: 100;
        }

        .nav-item {
            display: flex;
            flex-direction: column;
            align-items: center;
            color: #9e9e9e;
            font-size: 12px;
            cursor: pointer;
            transition: all 0.3s ease;
        }

        .nav-item.active {
            color: #ff6b35;
        }

        .nav-icon {
            font-size: 20px;
            margin-bottom: 4px;
        }

        /* 加载动画 */
        .loading {
            text-align: center;
            padding: 40px 20px;
        }

        .spinner {
            width: 36px;
            height: 36px;
            border: 4px solid #f3f3f3;
            border-top: 4px solid #ff6b35;
            border-radius: 50%;
            animation: spin 1s linear infinite;
            margin: 0 auto 20px;
        }

        @keyframes spin {
            0% { transform: rotate(0deg); }
            100% { transform: rotate(360deg); }
        }

        /* 弹窗样式 */
        .modal {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background-color: rgba(0, 0, 0, 0.5);
            z-index: 1000;
            justify-content: center;
            align-items: center;
        }

        .modal-content {
            background-color: white;
            border-radius: 16px;
            width: 85%;
            max-width: 320px;
            padding: 24px;
            text-align: center;
            transform: translateY(20px);
            opacity: 0;
            transition: all 0.3s ease;
        }

        .modal.show {
            transform: translateY(0);
            opacity: 1;
        }

        .modal-title {
            font-size: 20px;
            font-weight: bold;
            margin-bottom: 16px;
            color: #333;
        }

        .modal-message {
            margin-bottom: 24px;
            color: #666;
            line-height: 1.6;
        }

        .modal-actions {
            display: flex;
            gap: 12px;
        }

        .modal-btn {
            flex: 1;
            padding: 12px;
            border-radius: 8px;
            font-weight: bold;
            cursor: pointer;
            transition: all 0.3s ease;
        }

        .cancel-btn {
            background-color: #f5f5f5;
            color: #666;
        }

        .confirm-btn {
            background: linear-gradient(135deg, #ff6b35 0%, #f9a825 100%);
            color: white;
        }

        /* 响应式适配 */
        @media (max-width: 480px) {
            .header-content {
                padding-top: 4px;
            }
            
            .confirmation-card {
                padding: 24px 16px;
            }
            
            .action-buttons {
                flex-direction: column;
            }
        }

        /* 动画效果 */
        @keyframes fadeInUp {
            from {
                opacity: 0;
                transform: translateY(20px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        .confirmation-card, .activity-card, .registration-info {
            animation: fadeInUp 0.6s ease forwards;
        }

        /* 按钮状态动画 */
        .confirm-btn {
            animation: pulse 2s infinite;
        }

        @keyframes pulse {
            0% { transform: scale(1); }
            50% { transform: scale(1.02); }
            100% { transform: scale(1); }
        }

        /* 活动类型标签颜色 */
        .tag-sport { background-color: #e3f2fd; color: #1976d2; }
        .tag-learning { background-color: #f3e5f5; color: #7b1fa2; }
        .tag-social { background-color: #e8f5e9; color: #388e3c; }
        .tag-food { background-color: #fff3e0; color: #f57c00; }
        .tag-culture { background-color: #fce4ec; color: #c2185b; }
        .tag-outdoor { background-color: #e0f2f1; color: #00796b; }
    </style>
</head>
<body>
    <div class="container">
        <!-- 头部导航 -->
        <header class="header">
            <div class="header-content">
                <button class="back-btn" id="backBtn">←</button>
                <div class="header-title">报名确认</div>
                <button class="action-btn" id="helpBtn">?</button>
            </div>
        </header>

        <!-- 报名确认卡片 -->
        <div class="confirmation-card">
            <div class="confirmation-icon">✅</div>
            <h1 class="confirmation-title">报名成功！</h1>
            <p class="confirmation-subtitle">您已成功报名参加活动，准备好了吗？</p>
            
            <!-- 活动信息卡片 -->
            <div class="activity-card">
                <img src="https://images.unsplash.com/photo-1501854140801-50d01698950b?w=400&h=160&fit=crop" alt="户外徒步活动" class="activity-cover">
                <h2 class="activity-title">周末户外徒步活动</h2>
                
                <div class="activity-meta">
                    <div class="meta-item">
                        <span class="meta-icon">📍</span>
                        <span>城市公园</span>
                    </div>
                    <div class="meta-item">
                        <span class="meta-icon">⏰</span>
                        <span>周六 14:00 - 17:00</span>
                    </div>
                </div>
                
                <div class="activity-tags">
                    <span class="tag tag-sport">运动</span>
                    <span class="tag tag-outdoor">户外</span>
                </div>
            </div>

            <!-- 报名信息 -->
            <div class="registration-info">
                <h3 class="info-title">报名详情</h3>
                
                <div class="info-item">
                    <span class="info-label">报名时间</span>
                    <span class="info-value">2024年1月15日 14:30</span>
                </div>
                
                <div class="info-item">
                    <span class="info-label">报名状态</span>
                    <span class="info-value" style="color: #4caf50;">已确认</span>
                </div>
                
                <div class="info-item">
                    <span class="info-label">活动费用</span>
                    <span class="info-value">免费</span>
                </div>
                
                <div class="info-item">
                    <span class="info-label">参与人数</span>
                    <span class="info-value">12/15人</span>
                </div>
                
                <div class="info-item">
                    <span class="info-label">报名编号</span>
                    <span class="info-value">#A123456789</span>
                </div>
            </div>

            <!-- 操作按钮 -->
            <div class="action-buttons">
                <button class="action-btn cancel-btn" id="cancelBtn">取消报名</button>
                <button class="action-btn confirm-btn" id="confirmBtn">查看活动详情</button>
            </div>
        </div>

        <!-- 底部导航 -->
        <nav class="bottom-nav">
            <div class="nav-item" data-page="home">
                <span class="nav-icon">🏠</span>
                <span>首页</span>
            </div>
            <div class="nav-item" data-page="search">
                <span class="nav-icon">🔍</span>
                <span>搜索</span>
            </div>
            <div class="nav-item" data-page="publish">
                <span class="nav-icon">➕</span>
                <span>发布</span>
            </div>
            <div class="nav-item active" data-page="profile">
                <span class="nav-icon">👤</span>
                <span>我的</span>
            </div>
        </nav>

        <!-- 帮助弹窗 -->
        <div class="modal" id="helpModal">
            <div class="modal-content">
                <h3 class="modal-title">报名说明</h3>
                <p class="modal-message">
                    报名成功后，您将收到确认通知：<br><br>
                    • 活动开始前30分钟会有提醒<br>
                    • 可在"我的活动"中查看报名详情<br>
                    • 如需取消，请在活动开始前24小时操作<br>
                    • 活动当天请准时到达集合地点
                </p>
                <div class="modal-actions">
                    <button class="modal-btn cancel-btn" id="closeHelpBtn">知道了</button>
                </div>
            </div>
        </div>

        <!-- 取消确认弹窗 -->
        <div class="modal" id="cancelModal">
            <div class="modal-content">
                <h3 class="modal-title">确认取消</h3>
                <p class="modal-message">
                    您确定要取消报名参加<br>
                    "周末户外徒步活动"吗？
                </p>
                <div class="modal-actions">
                    <button class="modal-btn cancel-btn" id="cancelCancelBtn">取消</button>
                    <button class="modal-btn confirm-btn" id="confirmCancelBtn">确认取消</button>
                </div>
            </div>
        </div>

        <!-- 加载状态 -->
        <div class="loading" id="loadingIndicator">
            <div class="spinner"></div>
            <p>加载中...</p>
        </div>

        <!-- 通知 Toast -->
        <div id="toast" style="display: none; position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background-color: #4caf50; color: white; padding: 12px 24px; border-radius: 8px; box-shadow: 0 4px 12px rgba(0,0,0,0.15); z-index: 1001;"></div>
    </div>

    <script>
        // 全局变量
        let currentActivityId = '1';
        let isRegistered = true;

        // 初始化
        document.addEventListener('DOMContentLoaded', function() {
            initEventListeners();
            simulateLoading();
            
            // 模拟加载报名信息
            setTimeout(() => {
                updateRegistrationDisplay();
            }, 1000);
        });

        // 初始化事件监听器
        function initEventListeners() {
            // 返回按钮
            document.getElementById('backBtn').addEventListener('click', function() {
                window.history.back();
            });

            // 帮助按钮
            document.getElementById('helpBtn').addEventListener('click', function() {
                const modal = document.getElementById('helpModal');
                modal.classList.add('show');
            });

            // 关闭帮助弹窗
            document.getElementById('closeHelpBtn').addEventListener('click', function() {
                const modal = document.getElementById('helpModal');
                modal.classList.remove('show');
            });

            // 帮助弹窗背景点击关闭
            document.getElementById('helpModal').addEventListener('click', function(e) {
                if (e.target === this) {
                    this.classList.remove('show');
                }
            });

            // 确认按钮
            document.getElementById('confirmBtn').addEventListener('click', function() {
                alert('跳转到活动详情页面');
            });

            // 取消报名按钮
            document.getElementById('cancelBtn').addEventListener('click', function() {
                const modal = document.getElementById('cancelModal');
                modal.classList.add('show');
            });

            // 取消确认弹窗
            document.getElementById('confirmCancelBtn').addEventListener('click', function() {
                // 模拟取消报名
                showSuccessToast('已成功取消报名');
                closeCancelModal();
                
                setTimeout(() => {
                    // 跳转回首页或活动列表
                    alert('返回首页');
                }, 1000);
            });

            // 取消取消弹窗
            document.getElementById('cancelCancelBtn').addEventListener('click', closeCancelModal);

            // 取消弹窗背景点击关闭
            document.getElementById('cancelModal').addEventListener('click', function(e) {
                if (e.target === this) {
                    closeCancelModal();
                }
            });

            // 底部导航切换
            const navItems = document.querySelectorAll('.nav-item');
            navItems.forEach(item => {
                item.addEventListener('click', function() {
                    // 移除所有激活状态
                    navItems.forEach(i => i.classList.remove('active'));
                    // 添加当前激活状态
                    this.classList.add('active');
                    
                    const page = this.dataset.page;
                    handleNavigation(page);
                });
            });

            // 模拟报名状态更新
            setInterval(() => {
                updateRegistrationDisplay();
            }, 30000); // 每30秒更新一次
        }

        // 关闭取消报名弹窗
        function closeCancelModal() {
            const modal = document.getElementById('cancelModal');
            modal.classList.remove('show');
        }

        // 更新报名显示
        function updateRegistrationDisplay() {
            const statusElement = document.querySelector('.info-value');
            if (statusElement) {
                statusElement.textContent = isRegistered ? '已确认' : '已取消';
                if (isRegistered) {
                    statusElement.style.color = '#4caf50';
                } else {
                    statusElement.style.color = '#f44336';
                }
            }
        }

        // 处理导航切换
        function handleNavigation(page) {
            switch(page) {
                case 'home':
                    alert('跳转到首页');
                    break;
                case 'search':
                    alert('跳转到搜索页面');
                    break;
                case 'publish':
                    alert('跳转到发布页面');
                    break;
                case 'profile':
                    // 个人中心无需特殊处理
                    break;
            }
        }

        // 显示加载状态
        function showLoading() {
            const loading = document.getElementById('loadingIndicator');
            loading.style.display = 'block';
        }

        // 隐藏加载状态
        function hideLoading() {
            const loading = document.getElementById('loadingIndicator');
            loading.style.display = 'none';
        }

        // 模拟加载效果
        function simulateLoading() {
            showLoading();
            setTimeout(() => {
                hideLoading();
            }, 1500);
        }

        // 显示成功提示
        function showSuccessToast(message) {
            const toast = document.getElementById('toast');
            toast.textContent = message;
            toast.style.display = 'block';
            
            // 3秒后自动隐藏
            setTimeout(() => {
                toast.style.display = 'none';
            }, 3000);
        }

        // 添加触摸反馈效果
        const buttons = document.querySelectorAll('button');
        buttons.forEach(button => {
            button.addEventListener('touchstart', function() {
                this.style.transform = 'scale(0.95)';
            });
            
            button.addEventListener('touchend', function() {
                this.style.transform = 'scale(1)';
            });
        });

        // 添加页面滚动效果
        let lastScrollTop = 0;
        window.addEventListener('scroll', function() {
            const scrollTop = window.pageYOffset || document.documentElement.scrollTop;
            
            // 隐藏/显示底部导航
            const bottomNav = document.querySelector('.bottom-nav');
            if (scrollTop > lastScrollTop && scrollTop > 100) {
                bottomNav.style.transform = 'translateY(100%)';
            } else {
                bottomNav.style.transform = 'translateY(0)';
            }
            
            lastScrollTop = scrollTop;
        });

        // 添加返回顶部功能
        window.addEventListener('scroll', function() {
            if (window.pageYOffset > 300) {
                // 可以添加返回顶部按钮
            }
        });
    </script>
</body>
</html>
